<template>
    <view>
		i am demo
		
		<view @click="goDemo2">跳转到demo2</view>

    </view>
</template>

<script setup>
	const username='lisi'
	const userobj=ref({
		username:'liba',
		password:'123'
	})
	const goDemo2=()=>{
		uni.navigateTo({
			url:`/pages/demo2/demo2?name=${username}`
		})
	}
	console.log(getCurrentPages())
	
	// uni.hideHomeButton()
	
	uni.setStorageSync('name','liba')
		uni.setStorageSync('userobj',userobj.value)
		const deli=uni.getStorageSync('userobj')
		console.log('get storage',uni.getStorageSync('userobj'))
		console.log('deli username',deli.username)
// function request(){
// 	uni.request({
// 		url:"https://jsonplaceholder.typicode.com/posts",
// 		success:res=>{
// 			console.log('res',res)
// 		}
// 	})
	
// }
function requestCat(){
	uni.request({
		url:"https://tea.qingnian8.com/tools/petShow?size=10",
		success:res=>{
			console.log('cat res',res)
		}
	})
	
}
// request()
requestCat()
// https://tea.qingnian8.com/tools/petShow?size=10

</script>

<style lang="scss" scoped>

</style>
